<template>
  <div>
    {{ count }}
  </div>
  <button @click="handleClick">update</button>
  <p>{{ name }} {{ age }}</p>
  <Child />
</template>

<script setup>
import { ref, reactive, onMounted, defineProps, defineEmits } from "vue";
import Child from "./Child.vue";
// 声明接受props
// defineProps({ xxx: String });
// 声明接受自定义事件
// defineEmits(["xxx"]);

const count = ref(0);

const { name, age } = reactive({
  name: "jack",
  age: 18,
});

const handleClick = () => {
  count.value++;
};

onMounted(() => {
  console.log("onMounted");
});
</script>

<style scoped></style>
